home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / s-tatise.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  70 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                 GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS               --
  4. --                                                                          --
  5. --             S Y S T E M . T A S K _ T I M E R _ S E R V I C E            --
  6. --                                                                          --
  7. --                                  S p e c                                 --
  8. --                                                                          --
  9. --                             $Revision: 1.9 $                             --
  10. --                                                                          --
  11. --       Copyright (c) 1991,1992,1993,1994, FSU, All Rights Reserved        --
  12. --                                                                          --
  13. -- GNARL is free software; you can redistribute it  and/or modify it  under --
  14. -- terms  of  the  GNU  Library General Public License  as published by the --
  15. -- Free Software  Foundation;  either version 2, or (at  your  option)  any --
  16. -- later  version.  GNARL is distributed  in the hope that  it will be use- --
  17. -- ful, but but WITHOUT ANY WARRANTY;  without even the implied warranty of --
  18. -- MERCHANTABILITY  or  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Gen- --
  19. -- eral Library Public License  for more details.  You should have received --
  20. -- a  copy of the GNU Library General Public License along with GNARL;  see --
  21. -- file COPYING.LIB.  If not,  write to the  Free Software Foundation,  675 --
  22. -- Mass Ave, Cambridge, MA 02139, USA.                                      --
  23. --                                                                          --
  24. ------------------------------------------------------------------------------
  25.  
  26. --  Server to manage delays. Written in terms of System.Real_Time.Time
  27. --  and System.Task_Clock.Time.
  28.  
  29. with Ada.Calendar;
  30. --  Used for, Calendar.Time
  31.  
  32. with Ada.Real_Time;
  33. --  Used for, Real_Time.Time
  34. --            Real_Time.Time_Span
  35.  
  36. with System.Task_Clock;
  37. --  Used for, Stimespec
  38.  
  39. with System.Tasking;
  40. --  Used for, Protection
  41.  
  42. package System.Task_Timer_Service is
  43.  
  44. --  Implementing a proteced type using a single package
  45.  
  46.    protected type Signal_Object is
  47.       pragma Priority (Priority'Last);
  48.       entry Wait;
  49.       procedure Signal;
  50.       function Wait_Count return Integer;
  51.    private
  52.       Open   : Boolean := False;
  53.    end Signal_Object;
  54.  
  55.    protected Timer is
  56.       pragma Priority (Priority'Last);
  57.       procedure Service (T : out System.Task_Clock.Stimespec);
  58.       entry Enqueue_Time_Span (T : in Real_Time.Time_Span);
  59.       entry Enqueue_Duration (T : in Duration);
  60.       entry Enqueue_Real_Time (T : in Real_Time.Time);
  61.       entry Enqueue_Calendar_Time (T : in Ada.Calendar.Time);
  62. --   private
  63. --      procedure Time_Enqueue
  64. --        (T : in Task_Clock.Stimespec;
  65. --         N : in out Q_Link);
  66. --  ??? Private operations don't work.
  67.    end Timer;
  68.  
  69. end System.Task_Timer_Service;
  70.